package com.itheima.fanxing;

import com.itheima.domain.Student;

import java.util.ArrayList;
import java.util.Arrays;

/*
泛型方法的使用
 */
public class Demo03 {
    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();
        list.add(new Student("坤坤1",26));
        list.add(new Student("坤坤2",26));
        list.add(new Student("坤坤3",26));
        /*Student[] students = new Student[list.size()];
        for (int i = 0; i < list.size(); i++) {
           students[i]= list.get(i);
        }*/

        Student[] students =new Student[8] ;
        Student[] students1 = list.toArray(students);
        System.out.println(Arrays.toString(students));
        System.out.println(students==students1);
    }

}
